#pragma once

#include "ResourceDocument.h"
#include "DocumentManager.h"


class CFileManager :
	public CCmdTarget
{
	DECLARE_MESSAGE_MAP()

private:
	CResourceDocument &m_rDocument;
	CDocumentManager &m_rDocumentManager;

	BOOL m_bModified;
	BOOL m_bNamed;

	CFile m_ScriptFile;
	CFile m_HeaderFile;

	CString m_strTitle;

	int AskToSave();
	VOID ClearDocument();

	static CString GetFolderPath(CString &strFilePath);

public:
	CFileManager(CResourceDocument &a_rDocument, CDocumentManager &a_rDocumentManager);

	BOOL CreateNew();

	afx_msg void OnFileNew();
	afx_msg void OnFileOpen();
	afx_msg void OnFileSave();
	afx_msg void OnFileSaveAs();

};
